package com.javaspeak.algorithm.bubblesort.notrecursive;

import static org.junit.Assert.assertEquals;

import java.util.Arrays;

import org.junit.Test;
import org.junit.internal.TextListener;
import org.junit.runner.JUnitCore;

public class BubbleSortTest {

	@Test
	public void testBubbleSort(){
		
		String names[] = { "Bbb", "Aaa", "Ddd", "Eee", "Ccc" };
		String expected[] = { "Aaa", "Bbb", "Ccc", "Ddd", "Eee" };
		
		BubbleSort.bubbleSort( names );
		
		assertEquals( true, Arrays.equals( names, expected ) );
	}
	
	
	public static void main( String args[] ){
		
		JUnitCore junitCore = new JUnitCore();
		junitCore.addListener( new TextListener( System.out ) );
		junitCore.run( BubbleSortTest.class );		
	}
}
